import { useAxios } from '@/hooks/web/useAxios'
const request = useAxios()
import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 列表
export const zcLoanOrderListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcLoanOrderList',
      data: data
    }
  })
}

// 主表新增
export const zcLoanOrderAddAdminApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcLoanOrderAddAdmin',
      data: data
    }
  })
}

// 查看
export const zcLoanOrderSeeApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcLoanOrderSee',
      data: data
    }
  })
}

// 明细
export const zcLoanOrderDetailedListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcLoanOrderDetailedList',
      data: data
    }
  })
}

// 主表修改
export const zcLoanOrderEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcLoanOrderEdit',
      data: data
    }
  })
}

// 合同信息修改
export const zcLoanOrderContractEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcLoanOrderContractEdit',
      data: data
    }
  })
}
// 删除
export const zcLoanOrderDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcLoanOrderDel',
      data: data
    }
  })
}

// 审核
export const zcLoanOrderAdminExamineApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcLoanOrderAdminExamine',
      data: data
    }
  })
}

// 盘点
export const zcLoanOrderInventoryConfirmApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'zcLoanOrderInventoryConfirm',
      data: data
    }
  })
}

// 牧场信息
export const ucMyOrgListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucMyOrgList',
      data: data
    }
  })
}

// excel文件
export const dbLoanOrderDetailedListApi = (data: any) => {
  return request.post({
    url: '/index.php/tools/excel/common',
    headers: { token: wsCache.get('token') },
    data: {
      api_code: 'dbLoanOrderDetailedList',
      request: data.request,
      layout_data: data.layout_data
    }
  })
}
